Field of the Invention
The present invention relates to a communication apparatus that is capable of preventing data erroneous transmission, and a control method therefor, and a storage medium storing a control program therefor.
Description of the Related Art
In recent years, many image forming apparatuses mount a wireless LAN function. An image forming apparatus that mounts the wireless LAN function is generally provided with an infrastructure mode that is a function to connect with an access point wirelessly as a client.
A PC, a portable terminal, etc. communicate with an image forming apparatus through an access point, and transmit desired data and make it print, or receive apparatus information from the image forming apparatus to manage the apparatus, for example.
In one of addressing methods in the case where an image forming apparatus operates in such an infrastructure mode, an access point serves as a DHCP (Dynamic Host Configuration Protocol) server and distributes an IP address to the image forming apparatus that is served as a DHCP client.
Then, the image forming apparatus communicates with a PC, a portable terminal, etc. using the IP address distributed from the DHCP server.
On the other hand, “Wi-Fi Direct” (registered trademark) was recently enacted by the Wi-Fi Alliance. The Wi-Fi Direct regulates a protocol that automatically determines whether a wireless terminal operates as an access point or as a client.
Use of the Wi-Fi Direct makes it unnecessary to prepare an access point separately, and enables to execute various application services, such as an image share and a printing, with direct communication between wireless terminals.
FIG. 13 is a view schematically showing a process sequence of the Wi-Fi Direct. In the sequence shown in FIG. 13, it is assumed that both of an image forming apparatus and a portable terminal support the Wi-Fi Direct.
Each of the image forming apparatus and the portable terminal searches for another apparatus that is trying wireless connection in the Wi-Fi Direct, and finds a partner apparatus by detecting each other. When the partner apparatus is found, a roll of each apparatus is determined. The roll means an access point (Group Owner) or a client (Client). In this example, the image forming apparatus shall become an access point and the portable terminal shall become a client.
Next, the image forming apparatus and the portable terminal exchange parameters of wireless connection by using WPS (Wi-Fi Protected Setup) etc., and secure connection is established using the parameters.
Next, when the image forming apparatus distributes an IP address to the portable terminal by the DHCP, an IP connection is established.
Execution of this processing sequence enables direct communication between an application service mounted in the image forming apparatus and an application service mounted in the portable terminal.
Thus, the image forming apparatus allows two communications that are the communication using the Wi-Fi Direct and the communication in the infrastructure mode.
In this case, the IP address distributed to the portable terminal by the Wi-Fi Direct from the image forming apparatus may become identical to the IP address distributed as a DHCP client in the infrastructure mode from the access point.
If these IP addresses are identical, the image forming apparatus cannot determine whether a certain packet should be transmitted through the path of the wireless connection in the infrastructure mode or through the path of the wireless connection using the Wi-Fi Direct.
When the packet was transmitted to a wrong path, the communication using the packet concerned fails, and the packet that should not be flowed to the wrong path is flowed, which is not preferable from the point of view of security.
There is a known technique of avoiding overlap of the network address in the apparatus that is provided with the communication interfaces which enable a plurality of communications (for example, see Japanese Patent Publication No. 5010741 (JP 5010741B2)).
This patent discloses an addressing method to connect with different networks as a DHCP client and to obtain IP addresses from DHCP servers corresponding to the respective networks.
When the IP addresses obtained from the communication interfaces are identical, data erroneous transmission may occur. In such a case, the IP address concerned is distributed to only one communication interface, and is not distributed to the other communication interface. This avoids the situation where a plurality of communication interfaces operate with the same IP address.
However, the technique disclosed in the above-mentioned patent does not enable to communicate through the other communication interface to which an IP address is not distributed. Accordingly, the above-mentioned technique has a problem that prevention of erroneous transmission disturbs communication with a network device.